<template>
  <div>
      <h4>修改汽车信息</h4>
      编号：{{carObj.id}}<br>
      品牌：{{carObj.type}}<br>
      价格：<input type="text" v-model="carObj.price"><br>
      产地：{{carObj.address}}<br>
      <input type="button" value="修改" @click="updatePrice">
  </div>
</template>

<script>
export default {
    props:["carObj"],
    methods:{
        async updatePrice(){
            var info = await this.ajax.getSubmit("/project/car/update",{id:this.carObj.id,price:this.carObj.price});
            if(info == "ok"){
                this.$emit("find",{pageNO:1});
                alert("修改成功");
            }
            else{
                alert("修改失败");
            }
        }
    }
}
</script>

<style>

</style>
